<%--
  Created by IntelliJ IDEA.
  User: xiaoji
  Date: 2015/1/27
  Time: 16:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="session"/>
<!DOCTYPE html>
<html>
<head>
    <title>支付宝设置页面</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/icon.css">
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<div class="easyui-panel" title="支付宝设置" style="width:420px">
    <div style="padding:10px 60px 20px 60px">
        <form id="ff" class="easyui-form" method="post" data-options="novalidate:true">
            <table cellpadding="5">
                <tr>
                    <td>支付宝账号:</td>
                    <td><input class="easyui-textbox" type="text" name="alipayAccount" data-options="required:true" value="${alipayAccount}"></input></td>
                </tr>
                <tr>
                    <td>合作者身份id:</td>
                    <td><input class="easyui-textbox" type="text" name="alipayCardId" data-options="required:true" value="${alipayCardId}"></input></td>
                </tr>
                <tr>
                    <td>安全效验码key:</td>
                    <td><input class="easyui-textbox" type="text" name="alipayValidKey" data-options="required:true" value="${alipayValidKey}"></input></td>
                </tr>
            </table>
        </form>
        <div style="text-align:center;padding:5px">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">&nbsp;保&nbsp;&nbsp;存&nbsp;</a>
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">&nbsp;重&nbsp;&nbsp;置&nbsp;</a>
        </div>
    </div>
</div>
<script>
    function submitForm(){
        $('#ff').form('submit',{
            url:"${path}/setting/saveAlipay.do",
            onSubmit:function(){
                return $(this).form('enableValidation').form('validate');
            },
            success:function(data){
                if(data.errormsg == undefined){
                    $.messager.alert('操作提示', '操作成功', 'info');
                }else{
                    $.messager.alert('操作提示', data.errormsg, 'error');
                }

            }
        });
    }
    function clearForm(){
        $('#ff').form('clear');
    }
</script>
</body>
</html>
